<%--
  Created by IntelliJ IDEA.
  User: zhaocan
  Date: 2018/4/25
  Time: 15:25
  To change this template use File | Settings | File Templates.
--%>
<%@ include file="/WEB-INF/pages/common/meta.jsp"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<link class="css" rel="stylesheet" href="${ctx}/callcenter/phone2/css/phonebar.css"/>
<html>
<head>
    <title>话务中心话务条</title>
</head>
<body>
<div>
    <%--<iframe style="position: absolute;left:240px;top:0px;"id="frmPhone" name="frmPhone" width="745px" height="70px" frameborder="0" src="about:blank"></iframe>--%>
    <iframe style="position: absolute;left:160px;top:0px;text-align: center;"
            id="frmPhone" name="frmPhone" width="1100" height="70" frameborder="0" src="about:blank"></iframe>
</div>
<div id="divAgtMonitor"  class="s-dialog" style="display:none;position:fixed;z-index:1001;top:50px;">
    <button id="closeAgtMonitor" onclick="closeAgtMonitor()">关闭</button>
    <iframe id="frmAgtMonitor" name="frmAgtMonitor" width="100%" height="510px" frameborder="0" src="about:blank" ></iframe>
</div>

<div id="divRemoteCTI" style="display:none;position:fixed;z-index:1001;top:30px;width:700px;" class="s-dialog">
    <button id="closeRemoteCTI" onclick="closeRemoteCTI()">关闭</button>
    <iframe id="frmRemoteCTI" name="frmRemoteCTI" width="100%" height="510px" frameborder="0" src="about:blank"></iframe>
</div>

<%--<script src="${ctx}/callcenter/phone2/js/jquery-1.7.2.min.js" type="text/javascript"></script>--%>

<script type="text/javascript" >

    var dlgStatus = 0;
    var searchStr = location.search;
    $("#frmPhone").attr("src",G_CTX_PATH+"/callCenter/phone/phonebarIndex.do"+searchStr);

    var phone={
        toolsType:'zhuanjie',
        isMonitorOpen:false
    };

   /* $('#closeAgtMonitor').click(function(){alert("关闭");
        $("#divAgtMonitor").hide();
    });*/


    /*$('#closeRemoteCTI').click(function(){
        $("#divRemoteCTI").hide();
    });*/
    function closeAgtMonitor(){
        $("#divAgtMonitor").hide();
    }

    function divRemoteCTI(){
        $("#divRemoteCTI").hide();
    }
    //获取班长对话框iframe对象
    function getAgtMonitorFrame(){
        return document.getElementById("frmAgtMonitor");
    }

    //获取index工具条iframe对象
    function getPhoneFrame(){
        return document.getElementById("frmPhone");
    }

    //获取对话框状态，1－打开，0－关闭
    function getMonitorDlgStatus(){
        return dlgStatus;
    }

    //打开班长/转接弹出页
    function showAgtMonitorDlg(){
        dlgStatus = 1;
        if($("#frmAgtMonitor").attr("src")=="about:blank"){
            $("#frmAgtMonitor").attr("src",G_CTX_PATH+"/callCenter/phone/frmAgtMonitor.do");
        }

        var width = document.body.clientWidth;
        var height = document.body.clientHeight;
        $(".s-dialog").css({"top":(height-510)/2,"left":(width-700)/2});

        $("#divAgtMonitor").show();
    }

    function showRemoteCtiDlg(url){
        $("#frmRemoteCTI").attr("src",url);
        var width = document.body.clientWidth;
        var height = document.body.clientHeight;
        $(".s-dialog").css({"top":(height-510)/2,"left":(width-700)/2});
        $("#divRemoteCTI").show();
    }

    phone.closeAgtMonitor=function(){
        dlgStatus = 0;
        $("#divAgtMonitor").hide();
    };

    /**zhaocan 2018-05-02
     * 信息提示方法
     * */
    function  hgalert (msg) {
        showInfoMsg(msg);
        //HgUi.alert(msg);
    }
    /*
     var phone={
     toolsType:'zhuanjie',
     isMonitorOpen:false,
     topics:{},
     subscribeCnt:{}
     };

     //事件发布
     phone.event=function(id){
     var callbacks,topic = id && this.topics[id];
     var subCnt = this.subscribeCnt[id];
     var cnt = 0;
     if ( !topic ) {
     callbacks = jQuery.Callbacks();
     topic = {
     publish: callbacks.fire,
     subscribe: function(fn){
     callbacks.add(fn);
     if(subCnt) cnt=subCnt;
     cnt++;
     phone.subscribeCnt[id]=cnt;
     },
     unsubscribe: function(fn){
     callbacks.remove(fn);
     if(subCnt) cnt=subCnt;
     cnt--;
     if(cnt<0) cnt=0;
     phone.subscribeCnt[id]=cnt;
     }
     };
     if (id) {
     this.topics[id] = topic;
     }
     }
     return topic;
     };


     //打开班长/转接弹出页
     phone.showAgtMonitor=function(type){
     phone.toolsType=type;
     phone.isMonitorOpen=true;
     if($("#frmAgtMonitor").attr("src")=="about:blank"){
     $("#frmAgtMonitor").attr("src",G_CTX_PATH+"/callCenter/phone/frmAgtMonitor");
     }

     var width = document.body.clientWidth;
     var height = document.body.clientHeight;
     $(".s-dialog").css({"top":(height-510)/2,"left":(width-700)/2});

     $("#divAgtMonitor").show();
     try{$("#frmAgtMonitor")[0].contentWindow.showTools(type);}catch(e){}
     };

     //接收到请求打开班长功能
     phone.showRecvAgtReq=function(srcAgtId,srcAgtName,tmTime,actType,callId,content){
     $("#frmAgtMonitor")[0].contentWindow.onRecvAgtReq(srcAgtId,srcAgtName,tmTime,actType,callId,content);
     }

     //关闭班长/转接弹出页
     phone.closeAgtMonitor=function(){
     phone.isMonitorOpen=false;
     $("#divAgtMonitor").hide();
     };

     //获取工具条页面对象
     phone.getPhonePage=function(){
     return $("#frmPhone")[0].contentWindow;
     }
 */

</script>
</body>

</html>
